package org.xczy.core.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xczy.core.common.result.Result;
import org.xczy.core.entity.Menu;
import org.xczy.core.service.MenuService;

import javax.annotation.Resource;
import java.util.List;

@Api("菜单模块")
@RestController
@RequestMapping("/menu")
public class MenuController {

  @Resource
  private MenuService menuService;

  @ApiOperation("获取菜单列表")
  @GetMapping("/list")
  public Result getAllMenu(){
    List<Menu> menuList = menuService.getAllMenu();
    return Result.ok(menuList);
  }

}
